package com.ruoyi.yijing.service.impl;

import java.util.Date;
import java.util.List;

import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.yijing.domain.GuaVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.yijing.mapper.YjGuaiYaoMapper;
import com.ruoyi.yijing.domain.YjGuaYao;
import com.ruoyi.yijing.service.IYjGuaiYaoService;

/**
 * 卦和爻的关系Service业务层处理
 * 
 * @author ruoyi
 * @date 2024-01-22
 */
@Service
public class YjGuaiYaoServiceImpl implements IYjGuaiYaoService 
{
    @Autowired
    private YjGuaiYaoMapper yjGuaiYaoMapper;

    /**
     * 查询卦和爻的关系
     * 
     * @param yaoId 卦和爻的关系主键
     * @return 卦和爻的关系
     */
    @Override
    public YjGuaYao selectYjGuaiYaoByYaoId(Long yaoId)
    {
        return yjGuaiYaoMapper.selectYjGuaiYaoByYaoId(yaoId);
    }

    @Override
    public GuaVo selectYjGuaiYao(GuaVo vo) {
        return yjGuaiYaoMapper.selectYjGuaiYao(vo);
    }

    /**
     * 查询卦和爻的关系列表
     * 
     * @param yjGuaiYao 卦和爻的关系
     * @return 卦和爻的关系
     */
    @Override
    public List<YjGuaYao> selectYjGuaiYaoList(YjGuaYao yjGuaiYao)
    {
        return yjGuaiYaoMapper.selectYjGuaiYaoList(yjGuaiYao);
    }

    /**
     * 新增卦和爻的关系
     * 
     * @param yjGuaiYao 卦和爻的关系
     * @return 结果
     */
    @Override
    public int insertYjGuaiYao(YjGuaYao yjGuaiYao)
    {
        yjGuaiYao.setCreateBy(SecurityUtils.getUsername());
        yjGuaiYao.setCreateTime(new Date());
        return yjGuaiYaoMapper.insertYjGuaiYao(yjGuaiYao);
    }

    /**
     * 修改卦和爻的关系
     * 
     * @param yjGuaiYao 卦和爻的关系
     * @return 结果
     */
    @Override
    public int updateYjGuaiYao(YjGuaYao yjGuaiYao)
    {
        yjGuaiYao.setUpdateBy(SecurityUtils.getUsername());
        yjGuaiYao.setUpdateTime(new Date());
        return yjGuaiYaoMapper.updateYjGuaiYao(yjGuaiYao);
    }

    /**
     * 批量删除卦和爻的关系
     * 
     * @param yaoIds 需要删除的卦和爻的关系主键
     * @return 结果
     */
    @Override
    public int deleteYjGuaiYaoByYaoIds(Long[] yaoIds)
    {
        return yjGuaiYaoMapper.deleteYjGuaiYaoByYaoIds(yaoIds);
    }

    /**
     * 删除卦和爻的关系信息
     * 
     * @param yaoId 卦和爻的关系主键
     * @return 结果
     */
    @Override
    public int deleteYjGuaiYaoByYaoId(Long yaoId)
    {
        return yjGuaiYaoMapper.deleteYjGuaiYaoByYaoId(yaoId);
    }
}
